package com.yiwei.hdb.impl;

import android.content.Context;

import com.yiwei.hdb.constant.Const;
import com.yiwei.hdb.http.CallBackListener;
import com.yiwei.hdb.http.InterfaceServer;
import com.yiwei.hdb.interfaces.GoApplyInfo;
import com.yiwei.hdb.http.InfoCallBack;
import com.yiwei.hdb.model.RequestModel;
import com.yiwei.hdb.model.ResponseModel;

import java.util.HashMap;

/**
 * 支付页面
 */
public class GoApplyInfoImpl implements GoApplyInfo {

    public void getGoApplyInfo(Context paramContext, final InfoCallBack callBack) {
        RequestModel model = new RequestModel(new HashMap());
        InterfaceServer.getInstance(paramContext.getApplicationContext()).requestInterface(Const.GOAPPLY, Const.RequestMethod.POST, model, Const.DEFAULT_TIMEOUT, new CallBackListener<ResponseModel>(ResponseModel.class,callBack));
//                new ResponseListener() {
//            public void onFinishInMainThread(Object paramAnonymousObject) {
//            }
//
//            public void onStartInMainThread(Object paramAnonymousObject) {
//                callBack.onFailure(paramAnonymousObject.toString());
//            }
//
//            @Override
//            public void onSuccessInMainThread(int paramAnonymousInt, String paramAnonymousString, Object result) {
//                try {
//                    ResponseModel model = (ResponseModel) result;
//                    if (model.getStatus() == 1)
//                        callBack.onSuccess(model.getMsg());
//                    else callBack.onFailure(model.getMsg());
//                    //返回数据接口
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
//            }
//
//            @Override
//            public Object onSuccessInRequestThread(int statusCode, String content) {
//                try {
//                    return JsonUtil.<ResponseModel>fromJson(content, ResponseModel.class);
//                } catch (Exception e) {
//                    return null;
//                }
//            }
//        });
    }
}
